{tpl head}
<script src="{$skin}style/time/mobiscroll_002.js" type="text/javascript"></script>
<script src="{$skin}style/time/mobiscroll_004.js" type="text/javascript"></script>
<link href="{$skin}style/time/mobiscroll_002.css" rel="stylesheet" type="text/css">
<link href="{$skin}style/time/mobiscroll.css" rel="stylesheet" type="text/css">
<script src="{$skin}style/time/mobiscroll.js" type="text/javascript"></script>
<script src="{$skin}style/time/mobiscroll_003.js" type="text/javascript"></script>
<script src="{$skin}style/time/mobiscroll_005.js" type="text/javascript"></script>
<link href="{$skin}style/time/mobiscroll_003.css" rel="stylesheet" type="text/css">

<header class="header-fix main-nav bg-black header header-lg navbar navbar-fixed-top-xs box-shadow">
  <div class="container">
    <div class="navbar-header aside-sm"> <a class="btn btn-link visible-xs" href="javascript:history.back()"> <i class="icon iconfont">&#xf007a;</i> </a>
      <div class="navbar-brand">日常工作 </div>
        <a class="rbtn radius btn-warning" href="{$add}"> 添加 </a> </div>
  </div>
  </div>
</header>
<div class="middle-box loginscreen  animated fadeInDown mt60">
    <div class="m-t">
        <form action="?c=work" method="get">
        <input style="width:30%;float:left;" type="text" class="form-control no-border appDate" placeholder="开始日期" readonly="readonly" name="startdate"  value="">
        <input type="text" style="width:30%;float:left;" class="form-control no-border appDate" placeholder="结束日期" readonly="readonly" name="enddate" value="">
            <input type="hidden" name="c" value="work">
<input type="submit" name="search" class="" value="查询">
            </form>
    </div>
  <div class="m-t">
    <div class="dux-box">
      <div class="table-responsive">
      <table class="table table-hover">
    <thead>
      <tr>
       <th >工作内容</th>
      </tr>
   </thead>
   <tbody id="td">
   {loop $list $v}
          <tr onmouseover="this.style.cursor='pointer'" donclick="document.location='work-2.html';">
              <td>[{function=date('m-d',$v->startdate)}]{$name}
              <a href="?c=work&a=add&id={$v.id}"> {$v.title} {if $v.state}<img src="{$skin}style/images/yes.png"/>{else}
                  <img src="{$skin}style/images/no.gif"/></a>
                  {/if} </td>
         </tr>
   {/loop}

   </tbody>
</table>
          <a href="javascript:;" id="more" onclick="ViewMore();return false;">上拉或点击查看更多...</a>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript">
    window.page_prev = 1;
    var getTimes = function (times) {
        if (times >= 10000) {
            return parseInt(times / 10000) + "万";
        } else {
            return times;
        }
    }
    function ViewMoreCallback(data) {
        if (data.errorCode == 0) {
            $("#more").html("上拉或点击查看更多...")
            document.getElementById('infocon').appendChild(frag);
        }
    }
    var p=1;
    window.page_temp = 0;
    function ViewMore() {
        if($("#more").text()=='没有了')return false;
        $("#more").html("内容正在加载中...")
        p=p+1;
        $.ajax({
            type: "Get",
            url: "{$ajax}",
            dataType:'json',
            data: "p="+p,
            success: function(msg){
                listDate(msg)
            }
        });
    }

    function listDate(msg){
        var html = '';
        for(var i=0; i<msg.length;i++ )
        {
            html += '<tr><td>[';
            html += msg[i].date;
            html += ']';
            html += msg[i].name;
            html += decodeURI(msg[i].title);
            html += '</td></tr>';
        };
        if(!msg[0]){
            $("#more").text('没有了');
        }else{
            $('#td').append(html);
            $("#more").html("上拉或点击查看更多...")
        }
    }
    $(function () {
        var currYear = (new Date()).getFullYear();
        var opt={};
        opt.date = {preset : 'date'};
        opt.datetime = {preset : 'datetime'};
        opt.time = {preset : 'time'};
        opt.default = {
            theme: 'android-ics light', //皮肤样式
            display: 'modal', //显示方式
            mode: 'scroller', //日期选择模式
            dateFormat: 'yyyy-mm-dd',
            lang: 'zh',
            showNow: true,
            nowText: "今天",
            startYear: currYear - 10, //开始年份
            endYear: currYear + 10 //结束年份
        };

        $(".appDate").mobiscroll($.extend(opt['date'], opt['default']));
        var optDateTime = $.extend(opt['datetime'], opt['default']);
        var optTime = $.extend(opt['time'], opt['default']);
    });
</script>
{tpl foot}